<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/include/tagLib.jsp" %>
<!doctype html>
<html lang="en">
<head>
    <title>${sieName}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <%@include file="/include/cssLib.jsp" %>
</head>

<body>
<div class="container-fluid">
    <div class="row">
        <div class="col-md-12">
            <!-- 菜单 -->
            <tag:nav key="sysAdmin"/>

            <div class="tab-content">
                <div class="tab-pane active">
                    <div class="card col-md-10 col-md-offset-1">
                        <tag:sys-nav key="sysExList"/>
                        <div class="card-content">
                            <div class="tab-content">
                                <div class="tab-pane active">
                                    <div class="card">
                                        <div class="card-header">
                                            <div class="row">
                                                <form id="searchForm" action="${ctx}/adminConsole/sysEx/pageList" method="post">
                                                    <div class="row col-md-12">
                                                        <div class="col-md-2">
                                                            <select name="QF__EQ__module" class="selectpicker" data-style="select-with-transition" data-live-search="true">
                                                                <option value="">全部模块</option>
                                                                <option value="sys" ${'sys' eq searchCondMap['QF__EQ__module']?'selected':''}>系统</option>
                                                                <option value="search_api" ${'search_api' eq searchCondMap['QF__EQ__module']?'selected':''}>检索</option>
                                                                <option value="index_api" ${'index_api' eq searchCondMap['QF__EQ__module']?'selected':''}>索引</option>
                                                            </select>
                                                        </div>
                                                        <div class="col-md-2">
                                                            <input type="text" name="QF__EQ__type" value="${searchCondMap['QF__EQ__type']}" class="form-control clearable" placeholder="类型"/>
                                                        </div>
                                                        <div class="col-md-2">
                                                            <button type="submit" class="btn btn-twitter"><i class="fa fa-search"></i></button>
                                                            <input type="hidden" id="pageNo" name="pageNo"/>
                                                            <input type="hidden" id="pageSize" name="pageSize" />
                                                            <input type="hidden" id="orderBy" name="page.orderBy" value="${orderBean.orderBy}"/>
                                                            <input type="hidden" id="order" name="page.order" value="${orderBean.order}"/>
                                                            <a href="javascript: showMoreCondition()"  class="mgl-10 abs-bottom">更多条件...</a>
                                                        </div>
                                                    </div>
                                                    <div class="row col-md-12 more-conditions">
                                                        <div class="col-md-2">
                                                            <input type="text" name="QF__EQ__accessIp" value="${searchCondMap['QF__EQ__accessIp']}" class="form-control clearable" placeholder="访问者IP"/>
                                                        </div>
                                                        <div class="col-md-2">
                                                            <input type="text" name="QF__EQ__server" value="${searchCondMap['QF__EQ__server']}" class="form-control clearable" placeholder="服务机"/>
                                                        </div>
                                                        <div class="col-md-3">
                                                            <input type="text" id="rangeCreateDate" name="QF__BW__createTime" value="${searchCondMap['QF__BW__createTime']}" class="form-control" placeholder=" 录入时间"/>
                                                        </div>
                                                    </div>
                                                </form>
                                            </div>
                                        </div>
                                        <div class="card-content">
                                            <div class="material-datatables table-responsive">
                                                <table id="exList" class="table table-bordered table-hover">
                                                    <thead>
                                                    <tr>
                                                        <th width="30" class="text-center">#</th>
                                                        <th width="80" class="text-center">模块</th>
                                                        <th width="280">异常类型</th>
                                                        <th>简要</th>
                                                        <th width="120">访问者IP</th>
                                                        <th width="120">服务机</th>
                                                        <th width="150" sort-field="create_time">录入时间</th>
                                                    </tr>
                                                    </thead>
                                                    <tbody>
                                                    <c:forEach items="${pageResult.result }" var="data" varStatus="vStatus">
                                                        <tr>
                                                            <td class="text-center"></td>
                                                            <td>${data.module}</td>
                                                            <td>${data.type}</td>
                                                            <td>${data.brief}</td>
                                                            <td>${data.accessIp}</td>
                                                            <td>${data.server}</td>
                                                            <td>${fns:formatDateTime(data.createTime)}</td>
                                                        </tr>
                                                        <tr style="display: none;">
                                                            <td colspan="9" class="word-break">
                                                                <div class="pd-10">
                                                                    <textarea rows="20" class="form-control text-danger">${data.exception}</textarea>
                                                                </div>
                                                            </td>
                                                        </tr>
                                                    </c:forEach>
                                                    </tbody>
                                                </table>
                                            </div>
                                            <tag:paging page="${pageResult}"/>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>
<%@include file="/include/sidebarRight.jsp" %>
</body>
<%@include file="/include/scriptLib.jsp" %>
<script type="text/javascript">
    var markShowMore = "markShowMore_sysEx";
    $(document).ready(function() {
        //绑定排序
        FormUtil.bindOrder();
        //显示隐藏列+号
        TableUtil.showHideColumn("exList");
        //记住喜好（更多条件）
        CacheUtil.markLike(markShowMore, null, function(cacheVal){
            if("hide"==cacheVal){
                showMoreCondition();
            }
        });

        //日期时间范围
        laydate.render({
            elem: '#rangeCreateDate'
            ,type: 'datetime'
            ,max: 0
            ,range: true
        });
    });

    //显示更多条件
    function showMoreCondition(){
        var result = FormUtil.showMoreCondition('searchForm');
        CacheUtil.markLike(markShowMore, result);
    }

</script>
</html>